import React from 'react';
import { Menu, Button } from 'antd';
import {
  HomeOutlined,
  MailOutlined,
  LineChartOutlined,
  SolutionOutlined,
} from '@ant-design/icons';
import { history, Link } from 'umi';
const { SubMenu } = Menu;

export default function TeacherMenu() {
  return (
    <>
      <Menu
        mode="inline"
        defaultSelectedKeys={[history.location.pathname]}
        defaultOpenKeys={[
          history.location.pathname.slice(
            0,
            history.location.pathname.indexOf('/', 10),
          ),
        ]}
      >
        <Menu.Item key="/teacher/course" icon={<HomeOutlined />}>
          <Link to="/teacher/course">项目课程表</Link>
        </Menu.Item>
        <SubMenu key="/teacher/work" icon={<MailOutlined />} title="作业管理">
          <Menu.Item key="/teacher/work/arrangement">
            <Link to="/teacher/work/arrangement">下发作业</Link>
          </Menu.Item>
          <SubMenu key="/teacher/work" title="作业审批">
            <Menu.Item key="/teacher/work/correct/reply">
              <Link to="/teacher/work/correct/reply">未批复</Link>
            </Menu.Item>
            <Menu.Item key="/teacher/work/correct/replied">
              <Link to="/teacher/work/correct/replied">已批复</Link>
            </Menu.Item>
          </SubMenu>
        </SubMenu>
        <SubMenu
          key="/teacher/attendance"
          icon={<LineChartOutlined />}
          title="考勤管理"
        >
          <Menu.Item key="/teacher/attendance/index">
            <Link to="/teacher/attendance/index">项目考勤记录</Link>
          </Menu.Item>
          <Menu.Item key="/teacher/attendance/viewDetails">
            <Link to="/teacher/attendance/viewDetails">门禁打卡记录</Link>
          </Menu.Item>
        </SubMenu>
        <Menu.Item key="/teacher/askForLeave" icon={<SolutionOutlined />}>
          <Link to="/teacher/askForLeave">请假管理</Link>
        </Menu.Item>
        <SubMenu
          key="/teacher/score"
          icon={<LineChartOutlined />}
          title="综合打分"
        >
          <Menu.Item key="/teacher/score/personage">
            <Link to="/teacher/score/personage">个人评分</Link>
          </Menu.Item>
          <Menu.Item key="/teacher/score/group">
            <Link to="/teacher/score/group">小组评分</Link>
          </Menu.Item>
        </SubMenu>
        <Menu.Item key="/global/changePassword" icon={<SolutionOutlined />}>
          <Link to="/global/changePassword">修改密码</Link>
        </Menu.Item>
      </Menu>
    </>
  );
}
